import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet("/hello")
public class helloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 在服务器控制台打印
        System.out.println("hello servlet");
        ///这个是给resp的body写入hello字符串,这个内容就会被http响应返回给浏览器,显示到1浏览器页面上
        resp.getWriter().write("hello");
    }
}
